package org.arch_learn.dubbo_demo.service_provider.service;

import org.apache.dubbo.config.annotation.Service;
import org.arch_learn.dubbo_demo.api.DemoService;

import java.util.Random;

@Service
public class DemoServiceImpl implements DemoService {
    public String methodA() {
        int i = new Random().nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "call methodA";
    }

    public String methodB() {
        int i = new Random().nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "call methodB";
    }

    public String methodC() {
        int i = new Random().nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "call methodC";
    }
}
